package com.neu.his.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.neu.his.bo.drug.DrugItem;
import com.neu.his.bo.drug.DrugRec;
import com.neu.his.bo.drug.DrugSend;
import com.neu.his.bo.fee.FeeRec;
import com.neu.his.core.Result;
import com.neu.his.entity.DiagRecords;
import com.neu.his.entity.DrugDisturb;
import com.neu.his.entity.Patient;
import com.neu.his.mapper.DiagRecordMapper;
import com.neu.his.mapper.DrugDisturbMapper;
import com.neu.his.mapper.DrugMapper;
import com.neu.his.mapper.PatientMapper;
import com.neu.his.service.registFee02.DrugDisutrbService;
import com.neu.his.utils.PageList;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/drug_disturb")
@CrossOrigin
public class DrugDisturbController {
    @Autowired
    private DrugDisutrbService drugDisutrbService;

    @PutMapping("/query") //查询药品
    public Result queryDrug(@RequestBody FeeRec feeRec){
        return drugDisutrbService.queryDrug(feeRec);
    }

    @PutMapping //发药
    public Result deliverDrug(@RequestBody DrugRec drugRec){
        return drugDisutrbService.deliverDrug(drugRec);
    }

    @PutMapping("/withdrawal") //退药
    public Result withDrawalDrug(@RequestBody DrugRec drugRec){
        return drugDisutrbService.withDrawalDrug(drugRec);
    }

}
